#pragma once
#include "Runtime/CGI/CGIResource.h"

namespace Alice
{
    struct VulkanVertexDeclarationKey
    {
        VertexDeclarationElementList mVertexDeclarationElementList;
        uint32 mHash;
        uint32 mHashNoStrides;
        explicit VulkanVertexDeclarationKey(const VertexDeclarationElementList& inVertexDeclarationElementList);
        bool operator==(const VulkanVertexDeclarationKey&inOther) const
        {
            return mVertexDeclarationElementList.size() == inOther.mVertexDeclarationElementList.size() && 0==memcmp(mVertexDeclarationElementList.data(), inOther.mVertexDeclarationElementList.data(), mVertexDeclarationElementList.size() * sizeof(FVertexElement));
        }
    };
    class VulkanVertexDeclaration:public CGIVertexDeclaration
    {
    public:
        VertexDeclarationElementList mVertexDeclarationElementList;
        uint32 mHash;
        uint32 mHashNoStrides;
        VulkanVertexDeclaration(const VertexDeclarationElementList& inVertexDeclarationElementList, uint32 inHash, uint32 inHashNoStrides);
    };
}
template<>
struct std::hash<Alice::VulkanVertexDeclarationKey>
{
    size_t operator()(const Alice::VulkanVertexDeclarationKey& inVulkanVertexDeclarationKey) const noexcept
    {
        return inVulkanVertexDeclarationKey.mHash;
    }
};
